package com.example.demotest.repository;

import com.example.demotest.pojo.User;
import jakarta.validation.constraints.NotBlank;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.Optional;

@Repository
public interface UserRepository extends JpaRepository<User, Integer>, JpaSpecificationExecutor<User> {
    Optional<User> findByUserName(String userName);

    Optional<Object> findByNickname(@NotBlank(message = "昵称不能为空") String nickname);
}
